package day04;

import java.util.Scanner;

//此类使用于验证if双路分支的测试demo
public class Test02 {
    public static void main(String[] args) {
        //需求，购物金额大于等于500 8折。消费金额低于500打9折
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入想要的金额");
        double price = sc.nextInt();
        if (price >= 500) {
            price *= 0.8;
        }else {
            price *= 0.9;
        }
        System.out.println("打折后金额为" + price);
    }
}
